<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    div {
      width: 100px;
      height: 100px;
      background: red;
      animation: change 1s 3;
    }

    @keyframes change{
      100% {
        background: #000;
      }
    }
  
  </style>
</head>
<body>
  <div></div>
  <script>
    var div = document.querySelector('div')
    div.addEventListener('animationend', function () {
      console.log("动画结束")
    })
    
    div.addEventListener('animationstart', function () {
      console.log("动画开始")
    })

    div.addEventListener('animationiteration', function () {
      console.log("动画重复播放")
    })
  </script>
</body>
</html>